const express = require('express');
const router = express.Router();
const orderController = require('../controllers/orderController');
const { authenticateUserToken } = require('../middleware/jwtAuth');

// 获取订单列表（需要登录）
router.get('/', authenticateUserToken, orderController.getOrders.bind(orderController));

// 获取订单详情
router.get('/:orderNo', authenticateUserToken, orderController.getOrderDetail.bind(orderController));

// 取消订单
router.put('/:orderNo/cancel', authenticateUserToken, orderController.cancelOrder.bind(orderController));

module.exports = router;


